<script setup lang='ts'>
import userApi from '@/apis/userApi';
import userStore from '@/store/userStore';
import { onMounted } from 'vue';
import bloggerHeader from './components/blogger-header.vue';
 import bloggerBody from './components/blogger-title.vue';
 import {useRouter} from "vue-router"

 const router= useRouter()
 //加载的时候就加载用户
 onMounted(async () =>{
  const res=  await userStore().userChecked()
  if(res=="用户认证失败请重新登录" || sessionStorage.getItem("userInfo") ==null){
    router.push({name:'auth.login'})
  }

  if(sessionStorage.getItem("flash")=="flash_current_page"){
    router.go(0);
    sessionStorage.removeItem("flash");
  }
  
  
 })
</script>
<template>
 <div class="w-screen overflow-x-hidden overflow-y-hidden ">
    <el-container class="!mb-20">
      <el-header class="border-t-4 border-t-red-600 border-b-2 
     
       border-b-gray-300 shadow-md ">
        <!-- 头标签 -->
         <bloggerHeader/>
      </el-header>
      <div class=" min-h-screen mt-9  mb-20 bg-gray-100">
        <div>
            <!-- 博客的消息区-->
            <bloggerBody/>
         
        </div>
  
      </div>
    </el-container>
   <div class=" flex flex-col  -mt-[150px]">
      
    <div class="flex justify-center items-center ">
      <el-divider class="text-md text-gray-600" content-position="center">学易网,我们一起成长</el-divider>

    </div>
        <div class="flex justify-center mb-5 items-center">
          <el-avatar :size="80" src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.soogif.com%2FcmYqL5TFstRiiS7sPRewiHZRVmdOKO1d.gif&refer=http%3A%2F%2Fimg.soogif.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1672031853&t=979495e6b9cd7a7cd1f71f6e59350d6d" />
        
        </div>
   </div>
  </div>


</template>
<style  lang='scss'>

html{
   overflow-x: hidden;
}

::-webkit-scrollbar {

width: 8px;

}



::-webkit-scrollbar-track {

background-color: darkgrey;

}



::-webkit-scrollbar-thumb {

box-shadow: inset 0 0 6px rgba(97, 18, 209, 0.3);

}
</style>